﻿var symbolsInARow = 33;
var rowHeight = 14; // в пикселях
var minHeight = 36; // в пикселях
var startPosition = 0;
var isIE = (navigator.product != "Gecko");
var LANG_API_FILE_NOT_LOAD = "couldn't load Google Language API.\nYou seem to have troubles with your Internet connection.\nCheck your connection and restart the gadget."

var isLangAPIFileLoaded;
loadLangAPI();

function checkLangAPIFileLoaded()
{
	//Запостить сообщение об ошибке, если не загрузилось
	if (!isLangAPIFileLoaded)
	{
		outputPostErr(LANG_API_FILE_NOT_LOAD);
	}
	
	return isLangAPIFileLoaded;
}

function loadLangAPI()
{
	isLangAPIFileLoaded = (typeof(google) != "undefined");
	if (isLangAPIFileLoaded)
	{
		google.load("language", "1");
	}
}

// Запостить чё-нить в output
function outputPost(str)
{
	$("output").style.color = "#333";
	outputWrite(str);
}

function outputPostErr(str)
{
	$("output").style.color = "#ff4545";
	outputWrite("Error: " + str);
}

function outputWrite(str)
{
	$("output").innerHTML = str;
	j$("#outputScroll").jScrollPane(outputScrollSettings);
}

function max(a, b)
{
	return (a > b ? a : b);
}

function min(a, b)
{
	return (a < b ? a : b);
}